﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="StreetCareApplication.cs" company="Spenta Consulting">
//   (c) Copyright 2011
// </copyright>
// <summary>
//   Defines the StreetCareApplication type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Spenta.StreetCare.MVC.Helpers
{
    using System.Reflection;

    /// <summary>
    /// StreetCare application common properties
    /// </summary>
    public static class StreetCareApplication
    {
        /// <summary>
        /// Gets the product version.
        /// </summary>
        /// <value>The product version.</value>
        public static string ProductVersion
        {
            get
            {
                Assembly assembly = Assembly.GetExecutingAssembly();
                object[] attrs = assembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
                string infoVersion = string.Empty;
                if (attrs.Length >= 1 && attrs[0] is AssemblyInformationalVersionAttribute)
                {
                    infoVersion = ((AssemblyInformationalVersionAttribute)attrs[0]).InformationalVersion;
                }

                return infoVersion;
            }
        }
    }
}
